package com.fangcun.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Param;

import com.fangcun.bean.admin.user.response.LoginResponse;
import com.fangcun.bean.admin.user.response.UserDetailAdminResponse;
import com.fangcun.bean.api.user.response.UserResResponse;
import com.fangcun.entity.User;

public interface UserMapper {
	// 注销
	int deleteByPrimaryKey(Long id);

	int insert(User record);

	// 注册
	int insertSelective(User record);

	// 根据id查询 -用户详情
	User selectByPrimaryKey(Long id);

	User selectByAppidAndOpenid(@Param("appid") String appid, @Param("openid") String openid);

	User selectByPhone(String phone);

	// 修改用户信息
	int updateByPrimaryKeySelective(User record);

	int updateByPrimaryKey(User record);

	/** 资源端返回用户的查询 **/
	UserResResponse userResQuery(Long userId);

	// 后台管理-用户列表
	List<User> selectUser(User request);
	
	UserDetailAdminResponse selectByAdminId(Long id);
	
	
	/** =====================================后台部分 start================================================== **/

	LoginResponse selectByUserNameOrPhone(String userName);

	/** =====================================后台部分 end================================================== **/
}